# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from odoo import api, fields, models, _
from odoo.exceptions import UserError, ValidationError
from odoo.tools import float_is_zero

import logging

_logger = logging.getLogger(__name__)


class EcnBomWizards(models.TransientModel):
    _name = 'ecn.bom.wizards'

    ecn_id = fields.Many2one(comodel_name="ecn", string="ECN Document Number", ondelete="cascade")
    origin = fields.Char(string="Sales Order")
    record_type = fields.Integer("Type")  # 0. Original BOM, 1. Target BOM, 2. Work Order
    product_id = fields.Many2one(comodel_name="product.product", string="Product")
    production_id = fields.Many2one('mrp.production', 'Manufacturing Order', required=True)
    quan_bom = fields.Float(string='Quantity', digits='Product Unit of Measure')
    value_pnl = fields.Float(string='PCS/PANEL', digits='Product Unit of Measure')
    value_set = fields.Float(string='PCS/SET', digits='Product Unit of Measure')
    level = fields.Char("Level")
    plevel = fields.Char("Parent Level")
    is_m = fields.Char("Is Manufacturing Item")
